//
//  Person.m
//  UI08_homework(通讯录)
//
//  Created by Hanlingyu on 16/7/25.
//  Copyright © 2016年 ltq. All rights reserved.
//

#import "Person.h"

@implementation Person
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
    
}


- (instancetype)initWithName:(NSString *)name gender:(NSString *)gender age:(NSNumber *)age phoneNumber:(NSString *)phoneNumber {
    
    self = [super init];
    if (self) {
        _name = name;
        _age = age;
        _gender = gender;
        _phoneNumber = phoneNumber;
    }
    return self;
    
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    
    self = [super init];
    if (self) {
        _name = [aDecoder decodeObjectForKey:@"name"];
        _age = [aDecoder decodeObjectForKey:@"age"];
        _gender = [aDecoder decodeObjectForKey:@"gender"];
        _phoneNumber = [aDecoder decodeObjectForKey:@"phoneNumber"];
        
        
    }
    return self;
    
    
}

- (void)encodeWithCoder:(NSCoder *)aCoder {
    
    [aCoder encodeObject:_name forKey:@"name"];
    [aCoder encodeObject:_gender forKey:@"gender"];
    [aCoder encodeObject:_age forKey:@"age"];
    [aCoder encodeObject:_phoneNumber forKey:@"phoneNumber"];
    
    
    
    
    
}



@end
